<h2>Media</h2>

<%= Thoth::MainController.render_view('util/pager') %>

<table class="list media" summary="List of all media">
  <%= Thoth::MainController.render_view('util/table_sortheader') %>
  <tfoot></tfoot>
  <tbody>
    <% row = 'even' %>
    <% @files.all do |file| %>
      <tr class="<%= row == 'even' ? row = 'odd' : row = 'even' %>">
        <td class="filename">
          <a href="<%= Thoth::MediaController.r(:edit, file.id) %>"><%== file.filename %></a>
        </td>
        <td class="size"><%== file.size.filesize_format %></td>
        <td class="created">
          <%= file.created_at(Thoth::Config.timestamp['short']) %>
        </td>
        <td class="updated">
          <%= file.updated_at(Thoth::Config.timestamp['short']) %>
        </td>
      </tr>
    <% end %>

    <% if @pager.record_count == 0 %>
      <tr class="empty">
        <td colspan="4">
          No files to display.
        </td>
      </tr>
    <% end %>
  </tbody>
</table>

<%= Thoth::MainController.render_view('util/pager') %>
